package day04;

import java.util.Arrays;
import java.util.LinkedList;
import java.util.Queue;
import java.util.Scanner;


public class DecodeQQ {
    static Scanner cin = new Scanner(System.in);

    public static void main(String[] args) {
        Queue<Integer> q = new LinkedList<>();

        int n = cin.nextInt();
        for (int i = 0; i < n; i++) {
            q.offer(cin.nextInt());
        }
        System.err.println(q);
        while (!q.isEmpty()) {
            System.out.print(" " + q.peek());
            q.poll();
            if (q.isEmpty()) break;
            int x = q.peek();
            q.poll();
            q.offer(x);
        }
        System.err.println("ahut");
    }

}